class PagedDataResponse<T> {
  ///当前页结果集
  List<T>? list;

  ///当前页码
  int? pageNum;

  ///总页数
  int? pages;

  ///每页个数
  int? pageSize;

  ///所有个数
  int? total;

  PagedDataResponse({
    this.list,
    this.pageNum,
    this.pages,
    this.pageSize,
    this.total,
  });

  factory PagedDataResponse.fromJson(
    Map<String, dynamic> json,
    T Function(dynamic json) fromJsonT,
  ) => PagedDataResponse<T>(
    list: json['list'] == null
        ? null
        : (json['list'] as List<dynamic>).map(fromJsonT).toList(),
    pageNum: json['pageNum'] as int?,
    pages: json['pages'] as int?,
    pageSize: json['pageSize'] as int?,
    total: json['total'] as int?,
  );
}
